package com.sdry.web.controller.zc.quality;

import java.util.Date;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sdry.model.zc.ZcInspectionEntity;
import com.sdry.service.zc.ZcReportService;
import com.sdry.utils.ResponseUtil;

/**
 * 
 * @ClassName:    ZcReportController   
 * @Description:  不良品报检
 * @Author:       zc   
 * @CreateDate:   2018年10月10日 下午4:32:18   
 * @Version:      v1.0
 */
@Controller
@RequestMapping("report")
public class ZcReportController {

	@Resource
	private ZcReportService zcReportService;
	/**
	 * 保存不良品报检单
	 * @param request
	 * @param response
	 * @param zcInspectionEntity
	 */
	@RequestMapping("insertReport")
	public void insertReport(HttpServletRequest request,HttpServletResponse response,ZcInspectionEntity zcInspectionEntity){
		Date date = new Date();
		zcInspectionEntity.setiDate(date);
		int affact = zcReportService.insertReport(zcInspectionEntity);
		try {
			ResponseUtil.write(response, affact);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
